export function toRecordTime(val){
  if (typeof val == "number") {
    let h = Math.floor(val / 3600);
    let m = Math.floor((val % 3600) / 60);
    let s = val % 60;

    let hh = h < 10 ? "0" + h : h;
    let mm = m < 10 ? "0" + m : m;
    let ss = s < 10 ? "0" + s : s;
    return hh + ":" + mm + ":" + ss;
  }
  throw new Error("错误的时间类型");
}

export function toDurationTime(val){
  var arr = val.split(":")
  let hour = parseInt(arr[0])
  let minute = parseInt(arr[1]);
  let second = parseInt(arr[2]);
  let str = "";
  if(hour != 0){
    str += hour + "小时";
  }
  if(minute != 0){
    str += minute + "分钟";
  }
  if(second != 0){
    str += second + "秒"
  }
  return str;
}